<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <input v-model="message" placeholder="输入消息">
        <p>你输入的消息是: {{ message }}</p>
        <p>反转后的消息: {{ reversedMessage }}</p>
    </div>

    <script src="vue.global.js"></script>
    <script>
        const { createApp, ref, computed } = Vue;

        createApp({
            setup() {
                const message = ref('');

                // 计算属性
                const reversedMessage = computed(() => {
                    return message.value.split('').reverse().join('');
                });

                return {
                    message,
                    reversedMessage
                };
            }
        }).mount('#app');
    </script>

</body>

</html>